package com.mybatisplus.job;

import lombok.Getter;
import org.springframework.http.HttpStatus;
import static org.springframework.http.HttpStatus.BAD_REQUEST;

/**
 * 统一异常处理
 */
@Getter
public class BadRequestException extends RuntimeException {

    private boolean success;
    private Integer code = BAD_REQUEST.value();

    public BadRequestException(String msg){
        super(msg);
    }

    public BadRequestException(HttpStatus code, String msg){
        super(msg);
        this.code = code.value();
        this.success = false;
    }
}
